<?
require_once($r."_engine/types.php");
require_once($r."_engine/c_email_template.php");
require_once($r."_engine/table_editor/c_table_editor.php");

class CTableEditorEmailsTemplates extends CTableEditor
{
	function OnPrintData($f, &$v)
	{
		if (@$f['name'] == "template_text")
		{
			$v = substr($v, 0, 200);
		}

		$this->OnPrintDataStd($f, $v);
	}
}

$te_em_tpl = new CTableEditorEmailsTemplates();
$te_em_tpl->Init();
$te_em_tpl->table_name = "emails_templates";
$te_em_tpl->page_name  = "emails_templates";
$te_em_tpl->fields = 
	array(
		array('name'=>"id",					'title'=>"ID"),
		array('name'=>"template_name",		'title'=>"Template Name"),
		array('name'=>"email_from",			'title'=>"From"),
		array('name'=>"email_to",			'title'=>"To"),
		array('name'=>"email_cc",			'title'=>"CC"),
		array('name'=>"email_bcc",			'title'=>"BCC"),
		array('name'=>"email_subject",		'title'=>"Email Subject"),
		array('name'=>"template_text",		'title'=>"Template Text"),
	);
$te_em_tpl->order = "ORDER BY id ASC";
$te_em_tpl->allow_edit = true;
?>